package priv.mill.bigdata.mapper;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

/**
 * 
 * @author mill
 *
 */
public class WordCountReduce extends Reducer<Text, IntWritable, Text, IntWritable>{


	@Override
	protected void reduce(Text word, Iterable<IntWritable> counts,
			Reducer<Text, IntWritable, Text, IntWritable>.Context amountCount) throws IOException, InterruptedException {
		 int tem=0;
		for (IntWritable count : counts) {
			tem += count.get();
		}
		amountCount.write(word, new IntWritable(tem));
	}

}
